Support bundled Gemini CLI layout for OAuth credential extraction#728
Support bundled Gemini CLI layout for OAuth credential extraction#728icey-zhang wants to merge 1 commit intosteipete:mainfrom
Conversation
Newer versions of Gemini CLI (installed via npm) use a bundled format where all code is packed into `bundle/chunk-*.js` files instead of the traditional `dist/src/code_assist/oauth2.js` path. This caused token refresh to fail with "Could not find Gemini CLI OAuth configuration". Add `searchBundleDirectory` as a fallback that scans `chunk-*.js` files for embedded OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for catching and fixing the bundled Gemini CLI layout issue, @icey-zhang. This was a real compatibility gap. Since this PR was opened, has gained a broader Gemini CLI package-root discovery path that handles the bundled layout by walking from through its relative imports and parsing the OAuth constants from the imported bundle chunks. I also re-checked the current published package shape, and that newer path covers the same layout this PR targets. I’m going to close this one as superseded so the queue stays tidy, but thank you again for the sharp report and patch. |
|
Small correction: the inline code names were stripped from my previous comment by the shell. The intended details were: current |
Summary
bundle/chunk-*.jsfiles instead of the traditionaldist/src/code_assist/oauth2.jspathsearchBundleDirectoryfallback that scanschunk-*.jsfiles in the bundle directory for embeddedOAUTH_CLIENT_IDandOAUTH_CLIENT_SECRETTest plan
GeminiStatusProbetests pass~/.nvm/.../gemini-cli/bundle/chunk-*.jslayout)🤖 Generated with Claude Code